#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/7/8 21:48
# @USER    : Shengji He
# @File    : DivingBoard.py
# @Software: PyCharm
# @Version  : Python-
# @TASK:
from typing import List


class Solution:
    def divingBoard(self, shorter: int, longer: int, k: int) -> List[int]:
        """
        You are building a diving board by placing a bunch of planks of wood end-to-end. There are two types of planks,
        one of length shorter and one of length longer. You must use exactly K planks of wood. Write a method to
        generate all possible lengths for the diving board.

        return all lengths in non-decreasing order.

        Example:
            Input:
                shorter = 1

                longer = 2

                k = 3
            Output:  {3,4,5,6}
        Note:
            - 0 < shorter <= longer
            - 0 <= k <= 100000

        :param shorter:
        :param longer:
        :param k:
        :return:
        """
        ans = []
        if k == 0:
            return ans
        elif shorter == longer:
            return [shorter * k]
        for i in range(k + 1):
            ans.append(i * longer + (k - i) * shorter)
        return ans


if __name__ == '__main__':
    S = Solution()
    shorter = 1
    longer = 2
    k = 3
    print(S.divingBoard(shorter, longer, k))
    print('done')
